FROM openjdk:8-jdk-alpine
LABEL maintainer="wangscott<wang_yu5@hnair.com>"
ENV JAVA_TOOL_OPTIONS="-XX:+UseG1GC -XX:+HeapDumpOnOutOfMemoryError"
WORKDIR /opt
VOLUME /tmp
#设置时区&解决字体缺失报空指针
RUN echo "https://mirrors.aliyun.com/alpine/v3.9/main/" > /etc/apk/repositories && \
    echo "https://mirrors.aliyun.com/alpine/v3.9/community/" >> /etc/apk/repositories && \
    apk add --update ttf-dejavu fontconfig && \
    apk add tzdata && \
    ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
    echo "Asia/Shanghai" > /etc/timezone && \
    rm -rf /var/cache/apk/*
COPY target/*.jar app.jar
EXPOSE 8080
ENTRYPOINT ["java","-jar","/opt/app.jar"]